Skip to content

feat(ENG-821): setup and config field validation#183

Open
chandrajeet-singh wants to merge 3 commits into
StackOneHQ:mainfrom
chandrajeet-singh:feat(eng-821)/setup-and-config-field-validation
Open

feat(ENG-821): setup and config field validation#183
chandrajeet-singh wants to merge 3 commits into
StackOneHQ:mainfrom
chandrajeet-singh:feat(eng-821)/setup-and-config-field-validation

Conversation

@chandrajeet-singh

Copy link
Copy Markdown

No description provided.

@chandrajeet-singh chandrajeet-singh changed the title feat(eng-821): setup and config field validation feat(ENG-821): setup and config field validation Jul 8, 2026
Chandrajeet Singh and others added 2 commits July 8, 2026 15:48
- Anchor the local FORMAT_PATTERNS copy (url/uri; datetime requires
  seconds, optional fraction/offset) to match @stackone/core
- Add local FormatName copy and tighten FalconFieldValidation to the XOR
  shape matching the authoring contract
- Sync canonical accept/reject vectors in check-format-vectors (npm test)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chandrajeet-singh chandrajeet-singh marked this pull request as ready for review July 10, 2026 11:05
Copilot AI review requested due to automatic review settings July 10, 2026 11:05

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds client-side validation support for connector setup/config fields in the integration picker, including Falcon-style validation (format/pattern) while preserving legacy (v2) connector validation behavior. It also adds a small CI-style guard to keep a local copy of format regexes aligned with the canonical @stackone/core accept/reject vectors.

Changes:

  • Extend ConnectorConfigField.validation to support both legacy and Falcon validation contracts (including format-based validation).
  • Add a local FORMAT_PATTERNS registry and rule-resolution helpers to apply validations in the Zod schema builder.
  • Add a npm test script that runs a vector-check script to prevent regex drift.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/modules/integration-picker/utils/zodSchema.ts Introduces format/pattern validation resolution and applies the resolved regex rule to Zod field schemas.
src/modules/integration-picker/types.ts Adds typed validation contracts for legacy vs Falcon connectors and updates ConnectorConfigField.validation.
scripts/check-format-vectors.ts Adds a script to validate the local format regex registry against known accept/reject vectors.
package.json Updates npm test to run the new vector-check script via tsx.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +42
if (validation.type === 'html-pattern') {
return {
pattern: new RegExp(validation.pattern),
errorMessage:
validation.error || `Please match the required format: ${validation.pattern}`,
};
}
Comment on lines +44 to +50
if (validation.type === 'domain') {
return {
pattern: new RegExp(`.*${validation.pattern}\\.com.*`),
errorMessage:
validation.error || `Please enter a valid ${validation.pattern}.com domain`,
};
}
Comment on lines +66 to +71
if (validation.pattern) {
return {
pattern: new RegExp(validation.pattern),
errorMessage: validation.errorMessage || `${label} format is invalid`,
};
}
Comment on lines +59 to +65
for (const [format, vectors] of Object.entries(FORMAT_PATTERN_TEST_VECTORS)) {
const pattern = FORMAT_PATTERNS[format as keyof typeof FORMAT_PATTERNS];
if (!pattern) {
failures++;
console.error(`FAIL: registry is missing format "${format}"`);
continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants